﻿using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ATEGo
{
    /// <summary>
    /// 对应configuration.json
    /// 配置的起始文件
    /// </summary>
    public class ATEGo_Configuration
    {
        /// <summary>
        /// Orders文件所在路径
        /// </summary>
        public List<Dictionary<string,string>> OrderFiles;

        /// <summary>
        /// 命令集所在的路径
        /// </summary>
        public List<Dictionary<string, string>> CmdSuitFiles;

        /// <summary>
        /// 在命令中的变量名称
        /// </summary>
        public List<List<string>> ParamsInCmd;

        /// <summary>
        /// BOM列表
        /// </summary>
        public List<List<string>> BOM;

        /// <summary>
        /// 把cmdSuit的Name转成真正的路径
        /// </summary>
        /// <param name="CmdSuitsName"></param>
        public string CmdSuits_NameToPath(string CmdSuitsName)
        {
            foreach (var p in CmdSuitFiles)
            {
                if (p["name"].Trim()==CmdSuitsName.Trim())
                {
                    return p["path"].Trim();
                }
            }
            return null;
        }


    }
}
